#!/bin/bash
#host.os.system=windows
echo "because host system is windows,so need rebuild tools soft link"

if [ ! -L /vagrant/webapp/foxitcloudapp/web/tools ]; then
  cd /vagrant/webapp/foxitcloudapp/web
  rm tools
  ln -s ../../tools/sample/ tools
fi

if [ ! -L /vagrant/webapp/cpdfapiapp/web/tools ]; then
  cd /vagrant/webapp/cpdfapiapp/web
  rm tools
  ln -s ../../tools/sample/ tools
fi

if [ ! -L /vagrant/webapp/apiapp/web/tools ]; then
  cd /vagrant/webapp/apiapp/web
  rm tools
  ln -s ../../tools/sample/ tools
fi

if [ ! -L /vagrant/webapp/apiapp/web/v1/tools ]; then
  cd /vagrant/webapp/apiapp/web/v1
  rm tools
  ln -s ../../../tools/sample/ tools
fi

if [ ! -L /vagrant/webapp/apiapp/web/v3/tools ]; then
  cd /vagrant/webapp/apiapp/web/v3
  rm tools
  ln -s ../../../tools/sample/ tools
fi


echo "because host system is windows,so need rebuild icon soft link"

if [ ! -L /vagrant/webapp/foxitcloudapp/web/icon ]; then
  cd /vagrant/webapp/foxitcloudapp/web
  rm icon
  ln -s ../uploads/icon/ icon
fi

echo "because host system is windows,so need rebuild  api soft link"

if [ ! -L /vagrant/webapp/foxitarchiveapp/web/api ]; then
  cd /vagrant/webapp/foxitarchiveapp/web
  rm api
  ln -s ../../tools/sample/ api
fi